package lesson13;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * @author tongchen
 * @create 2023-02-12 21:48
 */
public class PutStream {
    public static void main(String[] args) throws IOException {
        //创建文件输入流
        InputStream fileInputStream = new FileInputStream("D:/360安全浏览器下载/test/aa/bb/test.txt");
        Scanner scan=new Scanner(fileInputStream,"unicode");
        System.out.println(fileInputStream.read());
        //在文件中读取下一行
        while(scan.hasNextLine()){
            String s = scan.nextLine();
            System.out.println(s);

        }
           scan.close();

            fileInputStream.close();
    }
}
